package com.kaili.zuul.service;

import com.kaili.common.entity.BaseMenu;
import com.kaili.common.entity.BaseUser;
import com.kaili.common.entity.LoginDetail;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

import java.util.List;
import java.util.Map;

public interface LoginService extends UserDetailsService {

    @Override
    LoginDetail loadUserByUsername(String s) throws UsernameNotFoundException;

    LoginDetail loadEmployeeByUsername(String s) throws UsernameNotFoundException;

    List<BaseMenu> getAllBaseMenu();

    Map getSiteByEmployeeId(Integer employeeId);

    String getCompanyName(Integer companyCode);

    String getParamValue(String paramKey);

    //往redis 存入数据
    Integer saveTranslate(String username, Integer translate);

    //取redis 数据
    Integer getTranslate(String username);


    @Cacheable(value = "verifyCode")
    String getVerifyCode(String phone);

    /**
     * 系统登陆成功后,根据当前语言环境,设置数据字典名称
     */
    void updateDict();

    //失败次数为4次账户锁定
    void updateUnlock(String name);

    //查询登陆可以错误几次
    String systemParmeterConfig(String name);

    //根据用户ID查询用户信息
    public BaseUser loadUserByUserid(Integer userId);

    //登录成功修改登录次数
    public int updateLoadTimes(Long id);

}
